package com.enlorenz.common.geo.map.google;

import com.enlorenz.common.geo.map.base.TileWrapper;
import com.enlorenz.util.StringUtil;


public class GoogleTileCmdConsole extends BaseTileCmdConsole{
	//URL模板
	private String urlTemplate="http://mt0.google.com/vt/lyrs=m@174000000&hl=zh-CN&src=app&x={0}&s=&y={1}&z={2}&s=Galileo";
	
	protected String getUrlTemplate(){
		return urlTemplate;
	}
	public void setUrlTemplate(String urlTemplate) {
		this.urlTemplate = urlTemplate;
	}
	@Override
	protected String getSourceUrl(TileWrapper googleTileWrapper) {
		String result=StringUtil.getTempateString(getUrlTemplate(), 
				new String[]{googleTileWrapper.getXtile(),googleTileWrapper.getYtile(),googleTileWrapper.getZoom()});
		return result;
	}
	
	/**
     * 如果读取瓦片失败
     * @param url
     * @param googleTileWrapper
     */
    protected void readTileFailed(String url, String filePath,
        TileWrapper googleTileWrapper) {
    }
}
